if (window.File && window.FileReader && window.FileList && window.Blob) {

    function onFileSelected(event) {
        var reader = new FileReader();
        reader.onerror = function(evt) {
            alert(evt.target.error);
        };
        reader.onload = function(evt) {
          load(event.target.result);  
        };

        var files = event.target.files;
        for (var i = 0, f; f = files[i]; i++) {
            reader.readAsArrayBuffer();
        }
    }
} else {
    alert('The File APIs are not fully supported in this browser! Please use another browser.');
}

